package org.gap.wizards.pc.skills;

import org.gap.wizards.pc.Skill;
import org.gap.wizards.utils.Dice;
import org.gap.wizards.utils.DiceBag;

public class BasicSkill implements Skill {

	private final String name;
	private final int level;
	private final DiceBag diceBag;

	public BasicSkill(String name, int level, DiceBag diceBag) {
		this.name = name;
		this.level = level;
		this.diceBag = diceBag;
	}

	@Override
	public ResultType rollWithModifier(int modifier) {
		int roll = diceBag.roll(Dice.D6, 3);
		return roll > level + modifier? ResultType.FAILURE: ResultType.SUCCESS;
	}

	@Override
	public String getName() {
		return name;
	}
}
